\chapter{Localization}
\label{ch:localization}
This chapter explains the setup that we have used for our positioning experiments, as well as the results achieved.

\section{Setup: School Yard}
This experiment was carried out just outside Engineering College of Aarhus. Figure~\ref{fig:posSetup} shows a picture of the environment.

\begin{figure}[!ht]
  \centering
  \includegraphics[width=0.9\textwidth]{PositioningSetup.jpg}
  \caption{Positioning Setup at School Yard}
  \label{fig:posSetup}
\end{figure}

The setup used four TelosB motes. We used three TelosB motes as anchor motes, and one TelosB mote was used as moving mote. The anchor motes were placed according to Figure~\ref{fig:posGrid}, Anchor mote with identification M17 was placed at location (0,0), anchor note with identification M16 was placed at location (7,0), and anchor note with identification M41 was placed at location (3.5, 3.5).

The moving mote was placed at 13 different locations inside the positioning grid marked in Figure~\ref{fig:posGrid} with numbers 1-13.  A PC was connected to the moving mote and at each point was 60 telegrams collected, giving app. 20 telegrams from each anchor mote.

\begin{figure}[!ht]
  \centering
  \includegraphics[width=0.5\textwidth]{figures/PositioningGrid.png}
  \caption{Positioning Grid}
  \label{fig:posGrid}
\end{figure}

\section{Results}
The processing for each positioning point (1-13) included calculating an average RSSI value for each anchor mote. The average RSSI value was then used to calculate distances from the moving mote to each anchor mote, using the Path Loss model with parameters defined empirically from in our outdoor experiment ($n=2.3$ and $A =-48$).

A reference plot was made as shown in Figure~\ref{fig:posRefPlot}. The reference plot shows two points for each positioning point (1-13), where the point marked with a number is the theoretical position, and the other point is the calculated position based on RSSI values.

\begin{figure}[!ht]
  \centering
  \includegraphics[trim = 19mm 19mm 19mm 19mm, width=14cm]{chart_pos_schoolyard.pdf}
%  \includegraphics[width=0.9\textwidth]{figures/PositioningReferencePlot.png}
  \caption{Reference plot}
  \label{fig:posRefPlot}
\end{figure}

An error plot, Figure~\ref{fig:posErrorPlot}, was generated showing the distance between the theoretical position and the measured position for each positioning point (1-13). The results gives an average error of 3.4 m, a minimum of 0.9 m, and a maximum of 9.9 m.  

\begin{figure}[!ht]
  \centering
  \includegraphics[trim = 19mm 19mm 19mm 19mm, width=14cm]{chart_pos_schoolyard_err.pdf}
%  \includegraphics[width=0.9\textwidth]{figures/PositioningErrorPlot.png}
  \caption{Error plot}
  \label{fig:posErrorPlot}
\end{figure}

The two positioning points giving more than 8 m error distance has been investigated further, and it seems that the most distant anchor mote is giving a lower RSSI value than expected, resulting in a larger distance for our trilateration calculation. The error might have been reduced by improved filtering on the RSSI values, and we might have introduced more anchor motes for our calculations.
